package xyz.xtt.asset.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Objects;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import xyz.xtt.asset.enums.AccountStateEnum;

/**
 * <p>
 * 铸作权帐户表
 * </p>
 *
 * @author author
 * @since 2025-02-25
 */
@Builder
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tbl_remint_account")
@ApiModel(value = "TblRemintAccount对象", description = "铸作权帐户表")
public class TblRemintAccount implements Serializable {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "主键")
	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	@ApiModelProperty(value = "帐户编号")
	private Long accountNo;

	@ApiModelProperty(value = "关联资产主键")
	private Long assetId;

	@ApiModelProperty(value = "拥有人id")
	private Long ownerId;

	@ApiModelProperty(value = "拥有数量")
	private BigDecimal amount;

	@ApiModelProperty(value = "version")
	private Long ver;

	@ApiModelProperty(value = "协议版本")
	private Long referProtocol;

	@ApiModelProperty(value = "状态0有效，1无效")
	private Integer state;

	@ApiModelProperty(value = "创建时间")
	private LocalDateTime createTime;

	@ApiModelProperty(value = "更新时间")
	private LocalDateTime updateTime;

	public Boolean isLock() {
		return Objects.equals(state, AccountStateEnum.LOCK.code());
	}
}
